import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import CourseList from '../views/CourseList.vue'
import Cart from '../views/Cart.vue'
import PaySuccess from '../views/PaySuccess.vue'
import CourseStudy from '../views/CourseStudy.vue'
import UserCenter from '../views/UserCenter.vue'
import CourseDetail from '../views/CourseDetail.vue'
import Checkout from '../views/Checkout.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/courses',
      name: 'CourseList',
      component: CourseList
    },
    {
      path: '/course/:id',
      name: 'CourseDetail',
      component: CourseDetail
    },
    {
      path: '/cart',
      name: 'Cart',
      component: Cart
    },
    {
      path: '/checkout',
      name: 'Checkout',
      component: Checkout
    },
    {
      path: '/pay-success',
      name: 'PaySuccess',
      component: PaySuccess
    },
    {
      path: '/course-study',
      name: 'CourseStudy',
      component: CourseStudy
    },
    {
      path: '/user',
      name: 'UserCenter',
      component: UserCenter
    }
  ]
})

export default router